#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
	int n, m, sum, num = 0, i, j;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		sum = 0;
		scanf("%d", &m);
		for (j = 0; j < m; j++) {
			scanf("%d", &num);
			sum += num;
		}
		printf("%d\n\n", sum);
	}

	return 0;
}